Black Rain mortar

The Black Rain mortar is a relatively simple power-up to define.  It only requires
five ODF files to complete the definition.  Furthermore, the graphical rendering is
relatively simple and uncomplicated with a lot of bells and whistles.

First, the power-up ODF, apbkrain.odf:

This is the one you refer to when placing the custom weapon on a map.
The parameters changed here are scrapCost and weaponName.  Everything else is much 
the same as what you would find in the Resin mortar power-up ODF.  The critical 
parameter is weaponName, which identifies the dependent weapon ODF.

[GameObjectClass]
geometryName = "apmort00.xsi"
classLabel = "wpnpower"
scrapCost = 30
scrapValue = 0
maxHealth = 150
maxAmmo = 0
unitName = NULL
aiName = "PowerUpProcess"

requireCount = 1
requireName1 = "fbstro"
requireText1 = "Build Stronghold"

lightHard1 = "hp_light_1"
lightName1 = "omnibrown"

[PowerUpClass]
soundPickup = "pickup01.wav"
soundReject = "reject.wav"

[WeaponPowerupClass]
weaponName = "gbkrain"


Next, the weapon ODF, gbkrain.odf:

This is an even smaller file than the power-up ODF but it contains more
critical parameters.  Those that have been changed from the model are 
ordName, wpnName, aiRange, salvoCount, salvoDelay and shotVariance.  

The ordName identifies the Ordnance ODF, wpnName specifies the text that
will be shown on the weapons load-out list on the game screen.  The other
weaponClass parameters are much the same as for the Resin mortar; however,
the aiRange, which determines how far out an AI unit will fire on an enemy
with this weapon, has been increased.

The salvoCount has been increased to throw out more "blobs", the salvoDelay
increased to gain more separation between the shots, and the shotVariance 
increased considerably to broaden the spread of the shots as they are sprayed 
from the mortar.

[WeaponClass]
classLabel = "mortar"
ordName = "bkrain"
wpnName = "Black Rain"
fireSound = "rmort01.wav"
wpnReticle = "gresin"
wpnLadder = "gmortar.L0"
wpnPriority = 2
wpnCategory = "MORT"
aiRange = 60

[CannonClass]
shotDelay = 0.0
salvoCount = 7
salvoDelay = 0.05
shotVariance = 0.35


Next, the ordnance ODF, bkrain.odf:

With this file we define how the weapon will look when fired in the game and 
how much damage it will do on impact.  Note the xplGround, xplVehicle and
xplBuilding parameters.  These identify the explosion ODF's which further
define appearance and damage.  We'll cover them in more detail later.

When creating your own ordnance ODF's, take care to get the renderName
parameter, and others like it, specified correctly.  Note that the renderName 
references a section called "Render" within the bkrain ODF.  If you forget to 
change this parameter, the ordnance may still work, but it will be using the
rendering parameters of another weapon.

AmmoCost determines how much ammo will be used per shot.  We're charging a bit
more for Black Rain than Resin.  LifeSpan determines how long the visual effects
of the ordnance will linger on screen.  Because our shotSpeed is the same as for
Resin but our range is greater, we need the Black Rain mortar to stick around 
quite a bit longer; otherwise, the shot will launch into the air and disappear
before it hits the ground or a target.

The damageValues are divided by type of armor or shielding.  We have a considerably
larger amount of damage allocated for Black Rain across the board.  Yes, the damageValue
for Stasis shielding is intentionally lower.  To my thinking, this type of shielding
might be effective against chemical attacks whereas none of the others would offer
any significant resistance.

Finally, the Render section defines how Black Rain will look when fired.  Fortunately,
there's not a lot that we have to define for Black Rain.  Some of the other weapons have
quite a few rendering sections.  Here, we only need one.  The renderBase and texture
parameters are the same as for Resin, almost everything else is different.  The startColor
is defined with RGB value 1,1,1, which is black.  The finishColor is RGB 1,1,63, which is
dark blue.  So, over the life of each Black Rain shot, its color will gradually change
from black to dark blue.  The startRadius and finishRadius are both quite a bit smaller
than for Resin.  This makes for a more compact blob.  The rotationRate is three times
higher than for Resin.  This makes the Black Rain blobs look more fluid; in combination
with the smaller size, this also makes them look more solid.

[OrdnanceClass]
classLabel = "grenade"

shotGeometry = NULL
shotRadius = 1.0
xplGround = "xbkrngnd"
xplVehicle = "xbkrnhit"
xplBuilding = "xbkrnhit"

renderName = "bkrain.render"

ammoCost = 3
lifeSpan = 15
shotSpeed = 30.0

damageValue(N) = 30
damageValue(L) = 30
damageValue(H) = 30
damageValue(S) = 20
damageValue(D) = 30
damageValue(A) = 30

[Render]
renderBase = "draw_twirl"
textureName = "gunk.tga"
textureBlend = "srcalpha invsrcalpha modulatealpha"
startColor = "1 1 1 255"
finishColor = "1 1 63 1"
startRadius = 0.2
finishRadius = 0.4
animateTime = 10.0
rotationRate = 3.0


Finally, the explosion ODF's, xbkrngnd.odf and xbkrnhit:

Most other weapons have three separate explosion ODF's for ground, vehicle and
building hits.  For Black Rain we only need two because the vehicle and building
hits do not need to be different.

Notice that many of the parameters here are similar to those in the ordnance ODF.
Here we define the damageRadius and damageValues for the explosions rendered when
a Black Rain blob strikes the ground, a vehicle or a building.

Unlike the Ordnance ODF, which has only one Render section, here we have three.  
Notice that we can name the sections pretty much whatever we want.  In this case 
the rendering section names are Ground, Chunks and Chunks2 for a ground hit, and
Core, Puff and Puff2 for the other types of hits.  This allows us to define a 
different explosion appearance for each type.  Further note that while we have
defined 3 particleTypes, each one can be rendered multiple times, as has been 
done for particleCount2.  The Resin explosions render only Ground or Core 
explosions and only one of the small Chunks or Puffs.  Black Rain provides a second
Chunk or Puff and an additional, larger Chunk2 or Puff2.

As with the Ordnance, each explosion rendering section defines the particle startColor,
finishColor, startRadius, finishRadius and animateTime.  We use these parameters to
control how large each particle will be as well as color, and how long they'll remain
on the screen.  In addition, here we define lifeTime for each particle.  Be aware that 
the animateTime should be the same as lifeTime if you want the full range of Color and
Radius gradient rendered.  If you specify a longer animateTime, the gradient will be
cut short; shorter and the gradient will be completed before the lifeTime expires.  
Those effects could actually be desirable depending on how you want an ordnance 
rendered.

As with the ordnance renderName, be careful with the particleClass names.  Note that
they refer to rendering sections in these ODF's.  If you forget to change them, you'll
end up using another weapon's rendering parameters.

// ================
// BLACK RAIN GROUND HIT
// ================

[ExplosionClass]
classLabel = "explosion"
explSound = "rmort02.wav"

damageRadius = 15.0

damageValue(N) = 5
damageValue(L) = 5
damageValue(H) = 5
damageValue(S) = 0
damageValue(D) = 5
damageValue(A) = 5

particleTypes = 3
particleClass1 = "xbkrngnd.ground"
particleCount1 = 1
particleVeloc1 = "0.0 0.0 0.0"
particleClass2 = "xbkrngnd.chunks"
particleCount2 = 2
particleVeloc2 = "5.0 5.0 5.0"
particleBias2 = "0.0 5.0 0.0"
particleClass3 = "xbkrngnd.chunks2"
particleCount3 = 1
particleVeloc3 = "5.0 5.0 5.0"
particleBias3 = "0.0 5.0 0.0"

[Ground]
simulateBase = "sim_null"
lifeTime = 10.0
renderBase = "draw_planar"
textureName = "grndchar.tga"
textureBlend = "srcalpha invsrcalpha modulatealpha"
startColor = "1 1 1 255"
finishColor = "1 1 63 1"
startRadius = 3.0
finishRadius = 15.0
animateTime = 10.0

[Chunks]
simulateBase = "sim_ember"
lifeTime = 4.0
renderBase = "draw_sprite"
textureName = "gunk.tga"
textureBlend = "srcalpha invsrcalpha modulatealpha"
startColor = "1 1 1 255"
finishColor = "1 1 63 1"
startRadius = 0.1
finishRadius = 0.1
animateTime = 4.0

[Chunks2]
simulateBase = "sim_ember"
lifeTime = 6.0
renderBase = "draw_sprite"
textureName = "gunk.tga"
textureBlend = "srcalpha invsrcalpha modulatealpha"
startColor = "1 1 1 255"
finishColor = "1 1 63 1"
startRadius = 0.2
finishRadius = 0.2
animateTime = 6.0


// ===================
// BLACK RAIN VEHICLE HIT
// ===================

[ExplosionClass]
classLabel = "explosion"
explSound = "rmort02.wav"

damageRadius = 7.5

damageValue(N) = 5
damageValue(L) = 5
damageValue(H) = 5
damageValue(S) = 0
damageValue(D) = 5
damageValue(A) = 5

particleTypes = 3
particleClass1 = "xbkrnhit.core"
particleCount1 = 1
particleVeloc1 = "0.0 0.0 0.0"
particleClass2 = "xbkrnhit.puff"
particleCount2 = 2
particleVeloc2 = "10.0 10.0 10.0"
particleBias2 = "0.0 3.0 0.0"
particleClass3 = "xbkrnhit.puff2"
particleCount3 = 1
particleVeloc3 = "10.0 10.0 10.0"
particleBias3 = "0.0 3.0 0.0"

[Core]
simulateBase = "sim_null"
lifeTime = 1.0
renderBase = "draw_twirl"
textureName = "gunk.tga"
textureBlend = "srcalpha invsrcalpha modulatealpha"
startColor = "1 1 1 127"
finishColor = "1 1 63 1"
startRadius = 1.0
finishRadius = 7.5
animateTime = 1.0

[Puff]
simulateBase = "sim_ember"
lifeTime = 4.0
renderBase = "draw_twirl"
textureName = "gunk.tga"
textureBlend = "srcalpha invsrcalpha modulatealpha"
startColor = "1 1 1 255"
finishColor = "1 1 63 1"
startRadius = 0.1
finishRadius = 0.1
animateTime = 4.0

[Puff2]
simulateBase = "sim_ember"
lifeTime = 6.0
renderBase = "draw_twirl"
textureName = "gunk.tga"
textureBlend = "srcalpha invsrcalpha modulatealpha"
startColor = "1 1 1 255"
finishColor = "1 1 63 1"
startRadius = 0.2
finishRadius = 0.2
animateTime = 6.0
